package com.linkwechat.web.controller.wecom;

import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.utils.sign.Base64;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.nio.charset.StandardCharsets;

@RequestMapping(value = "/wecom/weworkChatApp")
@RestController
public class WeWorkChatAppController extends BaseController {

    @GetMapping("/login")
    public AjaxResult login(@RequestParam String userId,@RequestParam String corpId){
        String token=Base64.encode(String.valueOf(userId+":"+corpId).getBytes(StandardCharsets.UTF_8));
        return AjaxResult.success("成功生成token",token);
    }
}
